import book.manage.dao.IInputDao;
import book.manage.po.Book;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;

public class Test {

    @org.junit.jupiter.api.Test
    public void test() throws IOException {
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("mybatis/mybatis-config.xml"));
        SqlSession session = sqlSessionFactory.openSession(true);
        IInputDao  iInputDao = session.getMapper(IInputDao.class);
        iInputDao.addBook(new Book("shz", "nb", 10.0));
    }
}
